package com.joven.product.api.business.client.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author Joven
 * @date 2022-01-06 18:21:27
 */
@Data
@Accessors(chain = true)
@ApiModel("商品详情DTO")
public class ProductDetail {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("商品编码")
    private String code;

    @ApiModelProperty("商品名称")
    private String name;

    @ApiModelProperty("商品价格")
    private BigDecimal price;

    @ApiModelProperty("0：待售，1：在售，2：下架")
    private Integer status;

    @ApiModelProperty("商品分类id")
    private Long categoryId;

    @ApiModelProperty("供应商id")
    private Long supplierId;

    @ApiModelProperty("创建人id")
    private Long createUser;

    @ApiModelProperty("更新人id")
    private Long updateUser;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("商品详情")
    private Detail detail;

    @ApiModelProperty("商品属性")
    private List<Attribute> attributes;

    @Data
    @ApiModel("商品详情DTO-商品详情")
    public static class Detail {
        @ApiModelProperty("商品标题")
        private String title;

        @ApiModelProperty("卖点")
        private String sellPoint;

        @ApiModelProperty("文案详情")
        private String detail;
    }

    @Data
    @ApiModel("商品详情DTO-商品属性")
    public static class Attribute {
        @ApiModelProperty("属性名称")
        private String name;

        @ApiModelProperty("属性值")
        private String value;

        @ApiModelProperty("属性类型：1基本属性，2销售属性")
        private Integer type;
    }
}